package com.hisense.store.batch.main;

import java.io.File;
import java.util.List;

import com.hisense.store.batch.main.util.SplitApk;

/**
 * @author minfanfu
 * @since
 */
public class Main
{
    public static void main(String[] args)
    {// 这里用cmd传入参数用
        System.out.println("====**====By Carter=====**======");

        // String apk = args[0];
        String apk = "E:\\1mf2\\workspace\\ApkBatch\\AppStore4.0.5.0.1.apk";
        System.out
            .println("apk:" + apk);

        String keyFile = "";
        String keyPasswd = "";

        // SplitApk sp = new SplitApk(filePath, keyFile, keyPasswd);
        SplitApk sp = new SplitApk(apk, keyFile, keyPasswd);
        sp.mySplit();
    }

    public static void listAllFiles(String filePath, List<File> listFiles)
    {
        File file = new File(filePath);

        try
        {
            if (file.exists())
            {
                if (file.isDirectory())
                {
                    File[] files = file.listFiles();
                    if (files != null)
                    {
                        for (int i = 0; i < files.length; i++)
                        {

                            if (files[i].isDirectory())
                            {
                                listAllFiles(files[i].getAbsolutePath(), listFiles);
                            } else
                            {

                                listFiles.add(files[i]);
                                // System.out.println(
                                // files[i].getName() + ": " + files[i].getAbsolutePath());
                            }

                        }
                    }
                }
                else
                {
                    listFiles.add(file);
                    // System.out.println(
                    // file.getName() + ": " + file.getAbsolutePath());
                }
            }
            else
            {
                System.out.println("请检查路径是否正确，或者检查路径是否有可读权限！");
            }
        } catch (Exception e)
        {
            System.out.println("请检查路径是否正确，或者检查路径是否有可读权限！");
            e.printStackTrace();
        }

    }
}
